package com.miniapp.constant;


import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;

import javax.annotation.PostConstruct;

/**
 * 全局的静态变量类
 */
@Component
public class SysConstants {

	public static final long SUPER_ADMIN = 1;

	public static String COMPONENT_APP_ID ;

	public static String VENICE_BACK_URL ;

	public static String VENICE_URL;

	public static String PROFILES_ACTIVE;

	/**
	 * 云存储配置KEY
	 */
	public final static String CLOUD_STORAGE_CONFIG_KEY = "CLOUD_STORAGE_CONFIG_KEY";

	/**
	 * CDN路径
	 */
	public static String CDN_DOMAIN_UPLOAD ;

	@Value("${venice.cdn.domain.upload}")
	private String cdnDomainUpload;
	@Value("${spring.profiles.active}")
	private String profilesActive ;
	@Value("${venice.back_url}")
	private String backUrl ;
	@Value("${wechat.component.app_id}")
	private String componentAppId ;
	@Value("${venice.url}")
	private String url ;
	@Value("${venice.ftp.address}")
	private String ftpAddress ;
	@Value("${venice.ftp.port}")
	private int ftpPort ;
	@Value("${venice.ftp.username}")
	private String ftpUsername ;
	@Value("${venice.ftp.password}")
	private String ftpPassword ;
	@Value("${venice.ftp.basepath}")
	private String ftpBasepath ;

	public static String FTP_ADDRESS ;
	public static int FTP_PORT ;
	public static String FTP_USERNAME ;
	public static String FTP_PASSWORD ;
	public static String FTP_BASEPATH ;

	@PostConstruct
	public void init() {
		CDN_DOMAIN_UPLOAD = cdnDomainUpload;
		PROFILES_ACTIVE  = profilesActive;
		VENICE_BACK_URL  = backUrl;
		VENICE_URL  = url;
		FTP_ADDRESS = ftpAddress;
		FTP_PORT = ftpPort;
		FTP_USERNAME = ftpUsername;
		FTP_PASSWORD = ftpPassword;
		FTP_BASEPATH = ftpBasepath;
		COMPONENT_APP_ID =componentAppId;

	}
}
